<template>
    <div class="comp-container" v-if="visible">
        <header>
            <div class="header-title-text">{{ title }}</div>
            <slot name="header-more">
                <div class="icon" @click="visible = false">
                    <el-icon>
                        <Close/>
                    </el-icon>
                </div>
            </slot>
        </header>
        <main>
            <slot></slot>
        </main>
        <footer>
            <slot name="footer"></slot>
        </footer>
    </div>
</template>

<script setup>
import {ref} from "vue";

const props = defineProps({
    title: {
        type: String,
        default: '容器标题'
    }
})


const visible = defineModel('visible', {default: true, type: Boolean})


function cancelEdit() {

}


</script>

<style scoped lang="less">
.comp-container {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    padding: 0 10px;
    z-index: 66;
    background: #202329;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;

    header {
        width: 100%;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 18px;
        background: rgba(40, 40, 40, 0.5);
        padding: 0 8px;
        border-radius: 8px;
        box-sizing: border-box;
        font-weight: 900;

        .icon {
            cursor: pointer;
        }
    }

    main {
        width: 100%;
        flex: 1;
        overflow-y: auto;
    }

    footer {
        width: 100%;
    }
}
</style>